<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
    <div class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
        <?php } ?>
    </div>
    <div id="community">
        <div id="forum-header">
            <?php echo $community_header; ?>
            <div>
                <h1><a href="<?php echo $headline_link; ?>"><?php echo $heading_title; ?></a></h1>
            </div>
        </div>
        <div id="cp-navi">
            <dl>
                <dd <?php echo $navi_m_active; ?>><a href="<?php echo $navi_m_link; ?>"><?php echo $text_main; ?></a></dd>
                <dd <?php echo $navi_mq_active; ?>><a href="<?php echo $navi_mq_link; ?>"><?php echo $text_moderation_queue; ?></a></dd>
                <dd <?php echo $navi_rm_active; ?>><a href="<?php echo $navi_rm_link; ?>"><?php echo $text_reported_messages; ?></a></dd>
                <dd <?php echo $navi_w_active; ?>><a href="<?php echo $navi_w_link; ?>"><?php echo $text_warnings; ?></a></dd>
                <dd <?php echo $navi_ml_active; ?>><a href="<?php echo $navi_ml_link; ?>"><?php echo $text_moderator_logs; ?></a></dd>
                <dd <?php echo $navi_b_active; ?>><a href="<?php echo $navi_b_link; ?>"><?php echo $text_banning; ?></a></dd>
                <dd <?php echo $navi_rde_active; ?>><a href="<?php echo $navi_rde_link; ?>"><?php echo $text_restore_deleted; ?></a></dd>
            </dl>
        </div>
        <div id="cp-main">
            <dl id="main-left">
                <?php $i=0; ?>
                <?php foreach($buttons as $key=>$button){ ?>
                <dd><a <?php echo ($key==$text_action) ? 'class="button_active"' :'' ?> href="<?php echo $button_links[$i]; ?>"><?php echo $button ; ?></a></dd>
                <?php $i++; ?>
                <?php } ?>
            </dl>
            <dl id="main-right">
                <dd id="main-right-top"><?php echo $mcp_heading; ?></dd>
                <dd id="main-right-bottom">
                    <?php switch($mode_type){
                          case 'm':?>
                        <?php require_once('mcp/main.tpl'); ?>
                        <?php break; ?>
                    <?php case 'mq': ?>
                        <?php require_once('mcp/moderation_queue.tpl'); ?>
                        <?php  break; ?>
                    <?php case 'rm': ?>
                        <?php require_once('mcp/reported_messages.tpl'); ?>
                        <?php  break; ?>
                    <?php case 'w': ?>
                        <?php require_once('mcp/warnings.tpl'); ?>
                        <?php  break; ?>
                    <?php case 'ml': ?>
                        <?php require_once('mcp/moderator_logs.tpl'); ?>
                        <?php  break; ?>
                    <?php case 'b': ?>
                        <?php require_once('mcp/banning.tpl'); ?>
                        <?php  break; ?>
                    <?php case 'rde': ?>
                        <?php require_once('mcp/restore_deleted.tpl'); ?>
                        <?php  break; ?>
                    <?php } ?>
                </dd>
            </dl>
            <dl class="clearfloat"></dl>
        </div>
    </div>
<?php  echo $footer; ?>
<script type="text/javascript" src="catalog/view/javascript/forum_fn.js"></script>
<script type="text/javascript"><!--
$('#community input[name=\'header-keyword\']').keydown(function(e) {
    if (e.keyCode == 13) {
        $('#header-search-button').trigger('click');
    }
});

$('#header-search-button').bind('click', function() {
url = 'index.php?route=community/search';

var keyword = $('#forum-header-bar-search input[name=\'header-keyword\']').attr('value');

url += '&kw=' + encodeURIComponent(keyword) + '&sw=psm&sb=lpt&or=desc&lr=all';

location = url;
});
//--></script>